package com.cheetah.start.common.valid.anno;


import cn.hutool.core.util.StrUtil;
import com.cheetah.start.common.valid.ValidDateValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 校验有效的日期,用于 String 类型参数
 *
 * @author 12392
 * @date 2021/07/27
 */
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {ValidDateValidator.class})
public @interface ValidDate {
    String pattern() default "yyyy-MM-dd";

    String message() default StrUtil.EMPTY;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
